﻿using PetaPoco;
using PmSoft;
using PmSoft.Caching;
using System.ComponentModel;
using static Modules.Project.ProjectConstants;

namespace Modules
{
    /// <summary>
    /// 项目修改信息申请表
    ///</summary>
    [TableName("project_update_apply")]
    [Description("项目修改信息申请记录")]
    [PrimaryKey("id", AutoIncrement = true)]
    [CacheSetting(true)]
    [Serializable]
    public class ProjectUpdateApply : IEntity
    {
        /// <summary>
        /// 项目ID
        ///</summary>
        [Column("id")]
        public int Id { get; set; }

        /// <summary>
        /// 项目ID
        ///</summary>
        [Column("project_id")]
        public int ProjectId { get; set; }

        /// <summary>
        /// 行业主管部门项目编号/住建：西藏自治区建筑市场监管平台项目编号
        ///</summary>
        [Column("industry_prj_num")]
        public string IndustryPrjNum { get; set; }

        /// <summary>
        /// 施工许可证编号
        ///</summary>
        [Column("builder_licences")]
        public string BuilderLicences { get; set; }

        /// <summary>
        /// 施工许可证发证日期
        ///</summary>
        [Column("builder_licences_grant_date")]
        public DateTime? BuilderLicencesGrantDate { get; set; }

        /// <summary>
        /// 施工许可证有效期限
        ///</summary>
        [Column("builder_licences_term_date")]
        public DateTime? BuilderLicencesTermDate { get; set; }

        /// <summary>
        /// 建设用地规划许可证编号。AES
        ///</summary>
        [Column("build_plan_num")]
        public string BuildPlanNum { get; set; }

        /// <summary>
        /// 建设工程规划许可证编号。AES
        ///</summary>
        [Column("prj_plan_num")]
        public string PrjPlanNum { get; set; }

        /// <summary>
        /// 项目所在城市。参考行政区划字典表
        ///</summary>
        [Column("city_code")]
        public int? CityCode { get; set; }

        /// <summary>
        /// 项目所在区县。参考行政区划字典表
        ///</summary>
        [Column("area_code")]
        public int? AreaCode { get; set; }

        /// <summary>
        /// 实际开工日期
        ///</summary>
        [Column("start_date")]
        public DateTime? StartDate { get; set; }

        /// <summary>
        /// 竣工日期，精确到 天，格式：yyyy-MM-dd
        ///</summary>
        [Column("end_date")]
        public DateTime? EndDate { get; set; }

        /// <summary>
        /// 联系人姓名
        ///</summary>
        [Column("link_man")]
        public string LinkMan { get; set; }

        /// <summary>
        /// 联系人办公电话
        ///</summary>
        [Column("link_phone")]
        public string LinkPhone { get; set; }

        /// <summary>
        /// 位置坐标数
        ///</summary>
        [Column("position_count")]
        public int? PositionCount { get; set; }

        /// <summary>
        /// 指工程建设项目中标合同价格，单位为元（不需要招投标的项目使用工程造价代替）
        ///</summary>
        [Column("contract_amount")]
        public decimal? ContractAmount { get; set; }

        /// <summary>
        /// 中标通知书编号
        ///</summary>
        [Column("letter_acceptance_num")]
        public string LetterAcceptanceNum { get; set; }

        /// <summary>
        /// 招标标段编号
        ///</summary>
        [Column("bidding_section_num")]
        public string BiddingSectionNum { get; set; }

        /// <summary>
        /// 指工程建设项目合同约定的项目开工日期
        ///</summary>
        [Column("contract_start_date")]
        public DateTime? ContractStartDate { get; set; }

        /// <summary>
        /// 指工程建设项目合同约定的项目竣工日期
        ///</summary>
        [Column("contract_end_date")]
        public DateTime? ContractEndDate { get; set; }

        /// <summary>
        /// 施工许可证发证日期
        ///</summary>
        [Column("license_date")]
        public DateTime? LicenseDate { get; set; }

        /// <summary>
        /// 施工许可证许可有效期限
        ///</summary>
        [Column("license_expire")]
        public DateTime? LicenseExpire { get; set; }

        /// <summary>
        /// 创建时间
        ///</summary>
        [Column("create_time")]
        public DateTime CreateTime { get; set; } = DateTime.Now;

        /// <summary>
        /// 创建时间
        ///</summary>
        [Column("creator")]
        public string Creator { get; set; }

        /// <summary>
        /// 审核类型
        /// </summary>
        [Column("audit_type")]
        public 项目修改申请状态 AuditType { get; set; }

        #region IEntity 成员

        [Ignore]
        object IEntity.EntityId { get { return this.Id; } }

        #endregion IEntity 成员
    }
}